<template>
	<component :is="cmp[props.type as keyof typeof cmp]" :attrs="$attrs" />
</template>

<script setup lang="ts">
import bar from "./bar/index.vue";
import line from "./line/index.vue";
import pie from "./pie/index.vue";
import { reactive } from "vue";

interface IProps {
	type: string;
}

const props = defineProps<IProps>();
const cmp = reactive({
	bar,
	line,
	pie,
});
</script>

<style scoped></style>
